<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<script src="../vue.js"></script>

<body>
  <div id="app">
    <div ref="div">test</div>
  </div>
  <script>
    const vm = new Vue({
      el: "#app",
      data: {
        msg: "wangwu",
      },
      beforeDistroy() {
        console.log("实例销毁之前！");

        console.log(this.$refs.div);

        console.log(this.$data.msg);

        console.log(vm);

      },
      distroyed() {
        console.log("实例销毁之后！");

        console.log(this.$refs.div);

        console.log(this.$data.msg);

        console.log(vm);
      }
    })
  </script>
</body>

</html>